package cn.lizemin.controller;

import cn.lizemin.feignclients.HystrixClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lzm
 * @version 1.0
 * @description: 测试服务熔断后的备选方案，当被调用服务宕机后，调用方能够调用
 * @date 2022/3/8 14:30
 */
@RestController
public class TestDemoController {

    //注入openfeign 客户端对象
    @Autowired
    private HystrixClient hystrixClient;

    @GetMapping("test")
    public String test(){
        System.out.println("test ok !!!");
        String demoResult = hystrixClient.demo(-1);
        System.out.println("demo result : "+demoResult);
        return "test ok ";
    }
}
